<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-serviceItems-add">
			<!--<div class="form-group">-->
				<!--<label class="col-sm-3 control-label">添加所属门店：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input  name="parentId" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">祖级列表：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="ancestors" name="ancestors" class="form-control" type="text">-->
				<!--</div>-->
<!--			</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">部门门店：</label>
					<div class="col-sm-8">
						<input name="deptId" type="hidden" id="treeId"/>
						<input  onclick="selectDeptTree()" id="treeName"   class="form-control" type="text" autocomplete="off" required >
					</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">服务项名称：</label>
				<div class="col-sm-8">
					<input id="siName" name="siName" class="form-control" type="text" required >
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">显示顺序：</label>
				<div class="col-sm-8">
					<input id="orderNum" name="orderNum" class="form-control" type="text" required >
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">服务项状态：</label>
				<div class="col-sm-8">
					<!--<input id="status" name="status" class="form-control" type="text">-->
					<select name="status" th:with="type=${@dict.getType('service_item')}" class="form-control" >
						<option value="">所有</option>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">创建时间：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="createTime" name="createTime" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">修改时间：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="updateTime" name="updateTime" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "item/serviceItems"
		$("#form-serviceItems-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-serviceItems-add').serialize());
	        }
	    }

		/*用户管理-新增-选择部门树*/
		function selectDeptTree() {
			var treeId = $("#treeId").val();
			var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
			var url = ctx + "system/dept/selectDeptTree/" + deptId;
			var options = {
				title: '选择部门',
				width: "380",
				url: ctx + "system/dept/selectDeptTree/" + deptId,
				callBack: doSubmit
			};
			$.modal.openOptions(options);
		}

		function doSubmit(index, layero){
			var tree = layero.find("iframe")[0].contentWindow.$._tree;
			if ($.tree.notAllowParents(tree)) {
				var body = layer.getChildFrame('body', index);
				$("#treeId").val(body.find('#treeId').val());
				$("#treeName").val(body.find('#treeName').val());
				layer.close(index);
			}
		}


	</script>
</body>
</html>
